package com.superm.controller;

import com.superm.utils.NumberToCN;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import java.math.BigDecimal;

/**
 * 工具类控制器
 */
@Controller
@RequestMapping("/utils")
public class UtilsController {


    /**
     * 转换大写金额
     * @return
     */
    @RequestMapping("/priceMax")
    @ResponseBody
    public  String priceMax(@RequestParam("price") Double price){
        String priceMax = NumberToCN.numberToCn(new BigDecimal(price));
        return priceMax;
    }
}
